package com.ruoyi.web.controller.system;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.framework.config.ServerConfig;
import com.ruoyi.lifecycle.service.ILifManageListService;
import com.ruoyi.system.domain.SysPurchaseApply;
import com.ruoyi.system.service.ISysPurchaseApplyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;


@Api(tags = "采购申请")
@RestController
@RequestMapping("/pur/apply")
public class SysPurchaseApplyController extends BaseController {

    @Autowired
    private ILifManageListService lifManageListService;


    /***
     * 修改采购申请状态:审核通过
     * @param
     * @return
     */
    @ApiOperation(value = "修改采购申请状态:部门领导审批")
    @PreAuthorize("@ss.hasPermi('system:apply:update')")
    @Log(title = "修改采购申请状态", businessType = BusinessType.UPDATE)
    @PutMapping(value = "/state/yes/{deviceId}")
    public AjaxResult updateState(@PathVariable Long deviceId) {
        return toAjax(lifManageListService.updateYesState(deviceId));
    }

}
